﻿//*****************************************************************************
//
//  Copyright 2008 IT Cloud Company
//
//  This software is available under the Microsoft Public License.  Please
//  read the license agreement at http://opensource.org/licenses/ms-pl.html
//  before using the software.
//
//  Authors:
//    Don Song (don@itcloud.com)
//
//*****************************************************************************

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;

namespace HeadLinx.AD.Common
{
    public static class ADUserPropertyNames
    {
        public const string FIRST_NAME = "givenName";
        public const string MIDDLE_NAME = "middleName";
        public const string LAST_NAME = "sn";

        public const string DISPLAY_NAME = "displayName";
        public const string EMAIL_ALIAS = "mailNickname";

        public const string THUMBNAIL_PHOTO = "thumbnailPhoto"; // Originally in Win2K server, some orgs seem to use this even in Win2003 AD

        public const string JPEG_PHOTO = "jpegPhoto"; // Available from Win2003, but not all orgs seem to use this yet

        public const string TITLE = "title";

        public const string COMPANY = "company";

        public const string DEPARTMENT = "department";
        public const string COST_CENTER = "extensionAttribute5";  // Note this is probably company specific!

        public const string PHYSICAL_OFFICE = "physicalDeliveryOfficeName";

        public const string PHONE = "telephoneNumber";
        public const string MOBILE_PHONE = "mobile";

        public const string MANAGER = "manager"; // distinguishedName of manager

        public const string COMMON_NAME = "cn";
        public const string DISTINGUISHED_NAME = "distinguishedName";
        public const string EMAIL_ADDRESS = "mail";
        public const string WWW_HOME_PAGE = "wWWHomePage";

        //
        //  Array containing all defined properties in an AD person object.
        //
        public static string[] All =
                {
                    ADUserPropertyNames.COMMON_NAME,
                    ADUserPropertyNames.COMPANY,
                    ADUserPropertyNames.COST_CENTER,
                    ADUserPropertyNames.DEPARTMENT,
                    ADUserPropertyNames.DISPLAY_NAME,
                    ADUserPropertyNames.DISTINGUISHED_NAME,
                    ADUserPropertyNames.EMAIL_ADDRESS,
                    ADUserPropertyNames.EMAIL_ALIAS,
                    ADUserPropertyNames.FIRST_NAME,
                    ADUserPropertyNames.LAST_NAME,
                    ADUserPropertyNames.MANAGER,
                    ADUserPropertyNames.MIDDLE_NAME,
                    ADUserPropertyNames.MOBILE_PHONE,
                    ADUserPropertyNames.PHONE,
                    ADUserPropertyNames.PHYSICAL_OFFICE,
                    ADUserPropertyNames.THUMBNAIL_PHOTO,
                    ADUserPropertyNames.TITLE,
                    ADUserPropertyNames.WWW_HOME_PAGE,
                };

        /// <summary>
        /// Adds all properties to collection.
        /// </summary>
        /// <param name="coll"></param>
        public static void AddAll(StringCollection coll)
        {
            foreach (string name in ADUserPropertyNames.All)
            {
                coll.Add(name);
            }
        }
    }
}
